#!/usr/bin/python

import unittest
class T(unittest.TestCase):

    def test_try_clause(self):
        result = None
        try:
            self.fail("Oops")
        except StandardError as ex: 
            result = 'exception handled'
            print ex

        self.assertEqual('exception handled', result)

        self.assertEqual(True, isinstance(ex, StandardError))
        self.assertEqual(False, isinstance(ex, RuntimeError))

        self.assertTrue(issubclass(RuntimeError, StandardError), \
            "RuntimeError is a subclass of StandardError")

        self.assertEqual('', ex[0])

def suite():
    loader = unittest.TestLoader()
    suite = unittest.TestSuite()
    loader.sortTestMethodsUsing = None

    suite.addTests(loader.loadTestsFromTestCase(T))

    return suite
if __name__ == "__main__":
    unittest.main(defaultTest = 'suite')
